"""
    whike 循环
        while 布尔型：

    for 循环
        for i in range（）：



"""
def whileSum():
    # 求1-100的和
    i=1
    # 计算和的变量
    sum=0
    while i <= 100:
        sum+=i
        i+=1
    return  sum
#定义一个函数可以求1-指定数的和
def forSum(num):
    sum=0
    for i in range(1,num+1):
        sum +=i
    return sum

def forJiSum(num):
    sum=0
    for i in range(1,num+1):
        if i%2!=0:
            sum += i
    return sum


if __name__ == '__main__':
    print(whileSum())
    print(forSum(200))
    print(forJiSum(100))



